<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <div class="app">
        <input type="text" v-model="firstName1">
        <input type="text" v-model="lastName1">
        <span>{{result1}}</span>
        <br>
        <input type="text" v-model="firstName2">
        <input type="text" v-model="lastName2">
        <span>{{result2}}</span>
    </div>
</body>
<script src="../vue.global.js"></script>
<script>
    Vue.createApp({
        data(){
            return {
                firstName1:"",
                lastName1:"",
                firstName2:"",
                lastName2:"",
                result2:""
            }
        },
        computed:{
            result1(){
                return this.firstName1 + this.lastName1;
            }
        },
        watch:{
            firstName2(newVal){
                this.result2 = newVal + this.lastName2;
            },
            lastName2(newVal){
                this.result2 = this.firstName2 + newVal;
            }
        }
    }).mount(".app")




</script>
</html>